﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>BE</title>
</head>

<body>

<h1>BE.SQL Server 2.0 beta</h1>
<p>Welcome to the 2.0 release beta! This release supports running multiple blogs 
from a single instance of the BE.Net runtime. This is enough added complication 
that we&#39;re putting together this little document to help you get everything up 
and running.</p>
<h2>Simple Configuration</h2>
<p>The simplest configuration is simply using BE.SQL Server to replace the data 
access layer built into BlogEngine.Net. You&#39;ll need to copy the binary files 
(all the .dll files) into the web applications bin folder.</p>
<p>The only core functionality difference we have over the built-in data access 
is that we allow you to configure the schema of the tables as well as a table 
prefix. i.e. the default name for the posts table is &quot;dbo.be_Posts&quot;. BE.Net 
allows you to configure a &quot;tablePrefix&quot; attribute on the blog provider to change 
the &quot;be_&quot; to be something you configure. We add a &quot;schema&quot; attribute as well 
that allows you to replace the &quot;dbo&quot; (aka owner) of the table. To use this 
functionality, you&#39;ll need to edit your web.config file to look something like 
this:</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
	<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">BlogEngine</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">  &lt;</span><span style="color: #a31515;">blogProvider</span><span style="color: blue;"> </span><span style="color: red;">defaultProvider</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">SQLBlogProvider</span>&quot;<span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">providers</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">      &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">XmlBlogProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">      &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">DbBlogProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">      &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">SQLBlogProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.SQLServer.SqlBlogProvider, BlogEngine.SQLServer</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;"> </span><span style="color: red;">tablePrefix</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">blog_</span>&quot;<span style="color: blue;"> </span><span style="color: red;">schema</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">webUser</span>&quot;<span style="color: blue;"> /&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;/</span><span style="color: #a31515;">providers</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">  &lt;/</span><span style="color: #a31515;">blogProvider</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">BlogEngine</span><span style="color: blue;">&gt;</span></pre>
</div>
<!--EndFragment-->
<p>Both tablePrefix and schema can be left off and the default values of &quot;be_&quot; 
and &quot;dbo&quot; will be used.</p>
<p>BE.SQL Server also includes classes to handle the membership and role 
provider functionality used by BlogEngine.Net. Both tablePrefix and schema are 
valid attributes there as well. Here is a sample setup that will enable BE.SQL 
Server for those providers:</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
	<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">membership</span><span style="color: blue;"> </span><span style="color: red;">defaultProvider</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">LinqMembershipProvider</span>&quot;<span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">  &lt;</span><span style="color: #a31515;">providers</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">clear</span><span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">XmlMembershipProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core</span>&quot;<span style="color: blue;"> </span><span style="color: red;">description</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">XML membership provider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">passwordFormat</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">Hashed</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">SqlMembershipProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">System.Web.Security.SqlMembershipProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine</span>&quot;<span style="color: blue;"> </span><span style="color: red;">applicationName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">DbMembershipProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core</span>&quot;<span style="color: blue;"> </span><span style="color: red;">passwordFormat</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">Hashed</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">LinqMembershipProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.SQLServer.LinqMembershipProvider, BlogEngine.SQLServer</span>&quot;<span style="color: blue;"> </span><span style="color: red;">passwordFormat</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">Hashed</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">  &lt;/</span><span style="color: #a31515;">providers</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">membership</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">roleManager</span><span style="color: blue;"> </span><span style="color: red;">defaultProvider</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">LinqRoleProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">enabled</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">true</span>&quot;<span style="color: blue;"> </span><span style="color: red;">cacheRolesInCookie</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">true</span>&quot;<span style="color: blue;"> </span><span style="color: red;">cookieName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">.BLOGENGINEROLES</span>&quot;<span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">  &lt;</span><span style="color: #a31515;">providers</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">clear</span><span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">XmlRoleProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core</span>&quot;<span style="color: blue;"> </span><span style="color: red;">description</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">XML role provider</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">SqlRoleProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">System.Web.Security.SqlRoleProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine</span>&quot;<span style="color: blue;"> </span><span style="color: red;">applicationName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">DbRoleProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">    &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">LinqRoleProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.SQLServer.LinqRoleProvider, BlogEngine.SQLServer</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;">/&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">  &lt;/</span><span style="color: #a31515;">providers</span><span style="color: blue;">&gt;</span></pre>
	<pre style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">roleManager</span><span style="color: blue;">&gt;</span></pre>
</div>
<!--EndFragment-->
<p>While all the possible providers are defined above, the one BlogEngine.Net 
will actually use is the one named under &quot;defaultProvider&quot;.</p>
<h2>Multiple Blogs</h2>
<p>First off, if you aren&#39;t using multiple blogs, you don&#39;t need to make any 
changes beyond what is included above. BE.SQL Server won&#39;t use any of the 
database changes if it doesn&#39;t need to.</p>
<p>Before moving forward, don&#39;t forget to 
<span style="color: #FF0000; font-weight: bold;">backup your 
database!</span></p>
<h3>Altering the Database</h3>
<p>Using multiple blogs in a single instance adds seven new tables and a new 
column on the Settings table. In addition, you need to add entries to these 
tables (and values in the column on the Settings table) for current blog data. A 
script has been provided that should automate all these steps. The file 
&quot;DatabaseSchemaChanges.sql&quot; should be included in the binary download or in the 
project base directory in the source download. This file includes the SQL Server 
scripts that updates your database with the appropriate changes.</p>
<p>The script file is a &quot;templated&quot; script to allow for easily configuring 
things that might be variable. In Management Studio or Query Analyzer, you fill 
in the values for template variables by hitting ctrl-shift-M. For most, the 
default should be adequate so simply hitting enter when prompted will likely be 
enough.</p>
<p>Make sure that you update the Host in the Blogs table to reflect the host 
portion of the URL people use for your blog. BE.SQL Server matches the value 
here against the <em>ending</em> of the host in the requested URL. Thus requests 
for both www.myblog.com and myblog.com will be matched if you enter &quot;myblog.com&quot; 
in the Host column.</p>
<p>The Path and Port columns allow you to differentiate blogs based on both port 
and path in the requested URL. Most people will likely leave these values null. 
BE.SQL Server matches the Path value against the <em>beginning</em> of a 
requested path and takes the shortest path matched as the blog to serve for the 
request.</p>
<h3>Web.config</h3>
<p>Once the data is correct, you&#39;ll need to let the blog know that it is working 
under multi-blog assumptions. This is done by adding 
	<span style="color: red;">multiblog</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">true</span>&quot;
to the blog provider.</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
	<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">SQLBlogProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.SQLServer.SqlBlogProvider, BlogEngine.SQLServer</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;"> </span><span style="color: red;">multiblog</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">true</span>&quot;<span style="color: blue;"> /&gt;</span></pre>
</div>
<!--EndFragment-->
<p>You don&#39;t technically <strong>have</strong> to add the multiblog attribute to 
the role and membership providers. If you don&#39;t, however, be aware that users 
and roles will apply across all configured blogs and the script to add new blogs 
will have to be edited accordingly (see below). Be aware as well that such 
functionality isn&#39;t actually tested.</p>
<p>Adding the multiblog attribute to the role and membership providers isn&#39;t 
difficult and you&#39;ll be left with something that looks like</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
	<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">LinqMembershipProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.SQLServer.LinqMembershipProvider, BlogEngine.SQLServer</span>&quot;<span style="color: blue;"> </span><span style="color: red;">passwordFormat</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">Hashed</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;"> </span><span style="color: red;">multiblog</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">true</span>&quot;<span style="color: blue;">/&gt;</span></pre>
</div>
<!--EndFragment-->
<p>and</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
	<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">LinqRoleProvider</span>&quot;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BlogEngine.SQLServer.LinqRoleProvider, BlogEngine.SQLServer</span>&quot;<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">BE</span>&quot;<span style="color: blue;"> </span><span style="color: red;">multiblog</span><span style="color: blue;">=</span>&quot;<span style="color: blue;">true</span>&quot;<span style="color: blue;">/&gt;</span></pre>
</div>
<!--EndFragment-->
<!--EndFragment-->
<h3>Adding a Blog</h3>
<p>To add a new blog, you&#39;ll need some basic data initiated in the blog. Again, 
a handy script is provided that should help in this task. You&#39;ll find the file 
AddNewBlog.sql in the zip file of the binary release or the project folder of 
the source release. As above this is a &quot;templated&quot; script so you&#39;ll need to hit 
ctrl-shift-M to enter the configured variables. If you are adding a value for 
Path, remember to include the single quotes around the string.</p>
<h3>Caution!</h3>
<p>Most of the data changes added to support multiple blogs have been made with 
care not to interfere with the default behavior of BlogEngine.Net. Indeed, 
removing multiple blogs can be as simple as removing &quot;multiblog&quot; from the 
providers. The exception to this general principle is the Settings table. 
Reverting to a single blog installation from a multiple blog setup doesn&#39;t
<strong>require</strong> that you make any changes to the Settings table <em>
unless</em> new settings are added or old ones taken away (in future versions?). 
This statement is theoretical, however, and thus may be incorrect.</p>

<h2>Support</h2>
<p>If you have questions or concerns or bugs or issues or things you want to 
discuss, please visit us at our
<a href="http://blogenginesqlserver.codeplex.com/">codeplex project page</a>. 
All feedback is welcome.</p>

<h3>IIS 7</h3>
<p>Because BlogEngine.Net ties into the Application Start event to load 
extensions, you&#39;ll need to make sure you are configured to run in &quot;Classic&quot; mode 
(instead of &quot;Integrated&quot;) in order to run correctly. This is due to the fact 
that in order to load the correct blog, we have to query the HttpContext.Request 
and that object isn&#39;t available in the Start event.</p>

</body>

</html>
